import { request } from "@/utils/service"
import type * as Login from "./types/login"
// import { da } from "element-plus/es/locale"
// import axios from "axios"

/** 获取登录验证码 */
export function getLoginCodeApi() {
  return request<Login.LoginCodeResponseData>({
    url: "/getCode",
    method: "get"
  })
}

/** 登录并返回 Token */

export function loginApi(data: Login.ILoginRequestData) {
  return request<Login.LoginResponseData>({
    url: "/login",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  })
}

/** 获取用户详情 */
export function getUserInfoApi() {
  return request<Login.UserInfoResponseData>({
    url: "/info",
    method: "get"
  })
}
/**重置密码 */
export function restPw(data: any) {
  return request<any>({
    url: "/resetPassword",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data"
    },
    data
  })
}
